<?php 
header("Content-type:text/html;charset=utf-8");
include_once 'sys/conn/conn.php';
$sql=mysql_query("select * from tb_content where c_type='公司新闻' order by uptime desc limit 0,7");
while ($result = mysql_fetch_array($sql)){
	if (strlen($result["title"]) > 40){
		$result["title"]=substr($result["title"],0,40)."...";
	}
	$content_com[]=$result;
}

$dt=mysql_query("select * from tb_content where c_type='行业动态' order by uptime desc limit 0,7");
while ($res = mysql_fetch_array($dt)){
if (strlen($res["title"]) > 40){
		$res["title"]=substr($res["title"],0,40)."...";
	}
	$content_dt[]=$res;
}

$query=mysql_query("select * from tb_content where c_type='政策法规' order by uptime desc limit 0,7");
while ($law = mysql_fetch_array($query)){
if (strlen($law["title"]) > 40){
		$law["title"]=substr($law["title"],0,40)."...";
	}
	$content_law[]=$law;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>中科智远--首页</title>
<link rel="stylesheet" href="style/style.css" type="text/css" />
<link rel="stylesheet" href="style/right-without.css" type="text/css" />
<link rel="stylesheet" href="style/select2css.css" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery.pikachoose.js"></script>
<script language="javascript">
jQuery(document).ready(function (){
	jQuery("#pikame").PikaChoose();
	
	var box = jQuery('.tab_content div.tab_combox');
	jQuery('.tab_menu ul li:first').addClass('active');
	jQuery('.tab_menu ul li').each(function(index){
		jQuery(this).click(function(){
			var now = jQuery(this);
			jQuery(now).addClass('active').siblings().removeClass('active');
			box.eq(index).fadeIn(500).siblings().hide();
		})
	})
});
</script>
</head>

<body>
	<?php include_once 'header.php';?>
    <div class="menu">
    	<ul>
        	<li class="home home_st"><a href="index.php" target="_self">首页</a></li>
            <li class="aboutZY"><a href="aboutZY.php" target="_self">关于智远</a>
			<li class="news"><a href="news.php" target="_self">新闻中心</a></li>
            <li class="products"><a href="spjk.php" target="_self">产品中心</a></li>
			<li class="kf"><a href="services.php" target="_self">客服中心</a></li>
            <li class="joinUs"><a href="joinUs.php" target="_self">加入我们</a></li>
        </ul>
        <div class="language">
            <div id="uboxstyle">
                <select name="language" id="language">
                    <option value="English">English</option>
                    <option value="简体中文" selected="selected">简体中文</option>
                </select>
            </div>
            <script type="text/javascript" src="js/select2css.js"></script>
        </div>
    </div>
    <div class="pikachoose">
        <ul id="pikame">
            <li><img src="images/banner1.png" width="756" height="234" alt="水务一体化"/></li>
            <li><img src="images/banner2.png" width="756" height="234" alt="建设工地监控监管"/></li>
            <li><img src="images/banner3.png" width="756" height="234" alt="餐饮业油烟监控系统"/></li>
            <li><img src="images/banner4.png" width="756" height="234" alt="banner"/></li>
        </ul>
    </div>
    <div class="shadow"><img src="images/shadow.jpg" width="946" height="22" alt="" /></div>
    <div class="tab">
    	<div class="tab_menu">
        	<ul>
            	<li>产品中心<span><img src="images/product.png" width="56" height="11" /></span></li>
                <li class="case">成功案例<span><img src="images/case.png" width="32" height="11" /></span></li>
                <li>新闻中心<span><img src="images/news.png" width="37" height="11" /></span></li>
            </ul>
        </div>
        <div class="tab_content">
        	<div class="tab_combox">产品展示</div>
            <div class="tab_combox" style="display:none;">成功案例</div>
            <div class="tab_combox" style="display:none;">
                <div class="boxn boxn_bg">
                    <h4><img src="images/green.jpg" width="6" height="5" />公司新闻</h4>
                    <ul>
	                <?php 
	                	foreach ($content_com as $row){
	                ?>
                        <li><a href="news_article.php?id=<?php echo $row["id"];?>" target="_self"><?php echo $row["title"];?></a><span><?php echo $row["uptime"];?></span></li>
                    <?php 
	                	}
                    ?>
                    </ul>
                    <a href="list_company_news.php" target="_self" class="more"><img src="images/more.png" width="32" height="13" /></a>
                </div>
                <div class="boxn boxn_bg">
                    <h4><img src="images/green.jpg" width="6" height="5" />行业动态</h4>
                    <ul>
                    <?php 
	                	foreach ($content_dt as $line){
	                ?>
                        <li><a href="news_article.php?id=<?php echo $line["id"];?>" target="_self"><?php echo $line["title"];?></a><span><?php echo $line["uptime"];?></span></li>
                    <?php 
	                	}
                    ?>
                    </ul>
                    <a href="list_hydt.php" target="_self" class="more"><img src="images/more.png" width="32" height="13" alt="more" /></a>
                </div>
                <div class="boxn">
                    <h4><img src="images/green.jpg" width="6" height="5" />政策法规</h4>
                    <ul>
                    <?php 
	                	foreach ($content_law as $col){
	                ?>
                        <li><a href="news_article.php?id=<?php echo $col["id"];?>" target="_self"><?php echo $col["title"];?></a><span><?php echo $col["uptime"];?></span></li>
                    <?php 
	                	}
                    ?>
                    </ul>
                    <a href="zcfg.php" target="_self" class="more"><img src="images/more.png" width="32" height="13" alt="more" /></a>
            	</div>
            </div>
        </div>
    </div>
    <?php include_once 'footer.php';?>
</body>
</html>
